<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>easytrip</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/base.css">
    <link rel="stylesheet" href="../css/easytrip-header.css">
    <link rel="stylesheet" href="../lib/layui/css/layui.css">
    <link rel="stylesheet" href="../css/easytrip-settlement-reconciliation.css">
    <link rel="shortcut icon" href="../favicon.ico" />
</head>
<body>
<div id="public-style">
</div>
<div class="content w clearfix">
    <div id="public-side"></div>
<div class="easytrip-reconciliation">
    <div class="easytrip-reconciliation-content">
        <!--高级搜索弹框-->
        <div class="hysearchfrom">
            <p>高级搜索</p>
            <form class="layui-form" action="">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">创建时间:</label>
                        <div class="layui-input-inline"  style="width: 140px;">
                            <input type="text" name="date" id="date1" autocomplete="off" class="layui-input" placeholder="请选择时间段">
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline" style="width: 140px;">
                            <input type="text" name="date" id="date2" autocomplete="off" class="layui-input" placeholder="请选择时间段">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">出账时间:</label>
                        <div class="layui-input-inline" style="width: 140px;">
                            <input type="text" name="date" id="date3" autocomplete="off" class="layui-input" placeholder="请选择时间段">
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline" style="width: 140px;">
                            <input type="text" name="date" id="date4" autocomplete="off" class="layui-input" placeholder="请选择时间段">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">入账时间:</label>
                        <div class="layui-input-inline" style="width: 140px;">
                            <input type="text" name="date" id="date5" autocomplete="off" class="layui-input" placeholder="请选择时间段">
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline" style="width: 140px;">
                            <input type="text" name="date" id="date6" autocomplete="off" class="layui-input" placeholder="请选择时间段">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item ">
                    <label class="layui-form-label">酒店名称:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="number" autocomplete="off" class="layui-input" placeholder="请输入酒店名称">
                    </div>
                </div>
                <div class="layui-form-item ">
                    <label class="layui-form-label">房型:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="number" autocomplete="off" class="layui-input" placeholder="请输入房型名称">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">订单编号:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="number" autocomplete="off" class="layui-input" placeholder="请输入订单编号">
                    </div>
                </div>
                <div class="layui-form-item ">
                    <label class="layui-form-label">所属销售员:</label>
                    <div class="layui-input-inline">
                        <select name="saleman">
                            <option value="">全部</option>
                            <option value="Annie">Annie</option>
                            <option value="Rossi">Rossi</option>
                            <option value="Shelly">Shelly</option>
                            <option value="Bella">Bella</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">收款对象:</label>
                    <div class="layui-input-inline" >
                        <input type="text" name="number" autocomplete="off" class="layui-input" placeholder="请输入">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">收款结算状态:</label>
                    <div class="layui-input-inline">
                        <select name="channel">
                            <option value="">全部</option>
                            <option value="已结算">已结算</option>
                            <option value="未结算">未结算</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">收款结算时间:</label>
                        <div class="layui-input-inline" style="width: 140px;">
                            <input type="text" name="date" id="date7" autocomplete="off" class="layui-input" placeholder="请选择时间段">
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline" style="width: 140px;">
                            <input type="text" name="date" id="date8" autocomplete="off" class="layui-input" placeholder="请选择时间段">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">结算人:</label>
                    <div class="layui-input-inline">
                        <select name="channel">
                            <option value="">全部</option>
                            <option value="lily">lily</option>
                            <option value="lisa">lisa</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">付款对象:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="number" autocomplete="off" class="layui-input" placeholder="请输入">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">付款结算状态:</label>
                    <div class="layui-input-inline">
                        <select name="channel">
                            <option value="">全部</option>
                            <option value="已结算">已结算</option>
                            <option value="未结算">未结算</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">付款结算时间:</label>
                        <div class="layui-input-inline" style="width: 140px;">
                            <input type="text" name="date" id="date9" autocomplete="off" class="layui-input" placeholder="请选择时间段">
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline" style="width: 140px;">
                            <input type="text" name="date" id="date10" autocomplete="off" class="layui-input" placeholder="请选择时间段">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">结算人:</label>
                    <div class="layui-input-inline">
                        <select name="channel">
                            <option value="">全部</option>
                            <option value="lily">lily</option>
                            <option value="lisa">lisa</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item bottom-btn">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                        <div id="cancel-btn">取消</div>
                        <button type="reset" class="layui-btn layui-btn-primary">清空条件</button>
                    </div>
                </div>
            </form>
        </div>
        <!--头部搜索（引用的产品中心的这个部分）-->
        <div class="easytrip-productheader">
            <span class="hotelname">酒店名称：</span>
            <input type="text" placeholder="请输入酒店名称/国家/省份/城市">
            <!--<i class="iconfont">&#xe601;</i>-->
            <i class="iconfont">&#xe668;</i>
            <span class="hysearch">高级搜索</span>
                <div class="button2 export-bill" type="button" onclick="method5('tableExcel')" onclick="method2('tableExcel')">导出账单</div>
        </div>
        <!--查看流水弹框-->
        <div class="money-water">
            <div class="money-water-header">
                <div class="monery-water-headerl f_left">收/付款流水</div>
                <!--<div class="monery-water-headerr f_right" id="money-water-hide">
                    <i class="layui-icon">&#x1006;</i>
                </div>-->
            </div>
            <div class="money-water-detail clearfix">
                <div class="groupnumber"><span>订单号:</span><span>789568954625689</span></div>
                <div class="groupnumber"><span>收入:</span><span class="roomstyle-price1">86956892.25</span></div>
                <div class="groupnumber"><span>支出:</span><span class="roomstyle-price">86956892.25</span></div>
            </div>
            <div class="money-water-table">
                <table class="layui-table">
                    <colgroup>
                        <col width="165">
                        <col width="75">
                        <col width="115">
                        <col width="95">
                        <col width="110">
                        <col width="97">
                        <col width="102">
                        <col width="175">
                        <col width="150">
                        <col width="95">
                        <col width="84">
                        <col>
                    </colgroup>
                    <thead>
                    <tr>
                        <th>客户名</th>
                        <th>收/支</th>
                        <th>收/支账日期</th>
                        <th>项目费用</th>
                        <th>金额</th>
                        <th>支付方式</th>
                        <th>收/支银行</th>
                        <th>收/支账号</th>
                        <th>流水号</th>
                        <th>结算状态</th>
                        <th>结算人</th>
                        <th>结算时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>长沙保利瑜璟阁...</td>
                        <td><span class="roomstyle-price1">收入</span></td>
                        <td>2017/10/17</td>
                        <td>房费</td>
                        <td><span class="roomstyle-price1">895689.86</span></td>
                        <td>转账</td>
                        <td>中国银行</td>
                        <td>8985698568956256</td>
                        <td>8985698568956</td>
                        <td><span class="roomstyle-price1">已结算</span></td>
                        <td>李丽丽</td>
                        <td>2017/10/17</td>
                    </tr>
                    <tr>
                        <td>长沙保利瑜璟阁...</td>
                        <td><span class="roomstyle-price">支出</span></td>
                        <td>2017/10/17</td>
                        <td>房费</td>
                        <td><span class="roomstyle-price1">895689.86</span></td>
                        <td>转账</td>
                        <td>中国银行</td>
                        <td>8985698568956256</td>
                        <td>8985698568956</td>
                        <td><span class="roomstyle-price">未结算</span></td>
                        <td>李丽丽</td>
                        <td>2017/10/17</td>
                    </tr>
                    <tr>
                        <td>长沙保利瑜璟阁...</td>
                        <td><span class="roomstyle-price1">收入</span></td>
                        <td>2017/10/17</td>
                        <td>房费</td>
                        <td><span class="roomstyle-price1">895689.86</span></td>
                        <td>转账</td>
                        <td>中国银行</td>
                        <td>8985698568956256</td>
                        <td>8985698568956</td>
                        <td><span class="roomstyle-price1">已结算</span></td>
                        <td>李丽丽</td>
                        <td>2017/10/17</td>
                    </tr>
                    <tr>
                        <td>长沙保利瑜璟阁...</td>
                        <td><span class="roomstyle-price1">收入</span></td>
                        <td>2017/10/17</td>
                        <td>房费</td>
                        <td><span class="roomstyle-price1">895689.86</span></td>
                        <td>转账</td>
                        <td>中国银行</td>
                        <td>8985698568956256</td>
                        <td>8985698568956</td>
                        <td><span class="roomstyle-price1">已结算</span></td>
                        <td>李丽丽</td>
                        <td>2017/10/17</td>
                    </tr>
                    <tr>
                        <td>长沙保利瑜璟阁...</td>
                        <td><span class="roomstyle-price">支出</span></td>
                        <td>2017/10/17</td>
                        <td>房费</td>
                        <td><span class="roomstyle-price1">895689.86</span></td>
                        <td>转账</td>
                        <td>中国银行</td>
                        <td>8985698568956256</td>
                        <td>8985698568956</td>
                        <td><span class="roomstyle-price">已结算</span></td>
                        <td>李丽丽</td>
                        <td>2017/10/17</td>
                    </tr>
                    <tr>
                        <td>长沙保利瑜璟阁...</td>
                        <td><span class="roomstyle-price1">收入</span></td>
                        <td>2017/10/17</td>
                        <td>房费</td>
                        <td><span class="roomstyle-price1">895689.86</span></td>
                        <td>转账</td>
                        <td>中国银行</td>
                        <td>8985698568956256</td>
                        <td>8985698568956</td>
                        <td><span class="roomstyle-price1">已结算</span></td>
                        <td>李丽丽</td>
                        <td>2017/10/17</td>
                    </tr>
                    <tr>
                        <td>长沙保利瑜璟阁...</td>
                        <td><span class="roomstyle-price1">收入</span></td>
                        <td>2017/10/17</td>
                        <td>房费</td>
                        <td><span class="roomstyle-price1">895689.86</span></td>
                        <td>转账</td>
                        <td>中国银行</td>
                        <td>8985698568956256</td>
                        <td>8985698568956</td>
                        <td><span class="roomstyle-price1">已结算</span></td>
                        <td>李丽丽</td>
                        <td>2017/10/17</td>
                    </tr>
                    <tr>
                        <td>长沙保利瑜璟阁...</td>
                        <td><span class="roomstyle-price1">收入</span></td>
                        <td>2017/10/17</td>
                        <td>房费</td>
                        <td><span class="roomstyle-price1">895689.86</span></td>
                        <td>转账</td>
                        <td>中国银行</td>
                        <td>8985698568956256</td>
                        <td>8985698568956</td>
                        <td><span class="roomstyle-price1">已结算</span></td>
                        <td>李丽丽</td>
                        <td>2017/10/17</td>
                    </tr>
                    <tr>
                        <td>长沙保利瑜璟阁...</td>
                        <td><span class="roomstyle-price">支出</span></td>
                        <td>2017/10/17</td>
                        <td>房费</td>
                        <td><span class="roomstyle-price1">895689.86</span></td>
                        <td>转账</td>
                        <td>中国银行</td>
                        <td>8985698568956256</td>
                        <td>8985698568956</td>
                        <td><span class="roomstyle-price1">已结算</span></td>
                        <td>李丽丽</td>
                        <td>2017/10/17</td>
                    </tr>
                    <tr>
                        <td>长沙保利瑜璟阁...</td>
                        <td><span class="roomstyle-price1">收入</span></td>
                        <td>2017/10/17</td>
                        <td>房费</td>
                        <td><span class="roomstyle-price1">895689.86</span></td>
                        <td>转账</td>
                        <td>中国银行</td>
                        <td>8985698568956256</td>
                        <td>8985698568956</td>
                        <td><span class="roomstyle-price1">已结算</span></td>
                        <td>李丽丽</td>
                        <td>2017/10/17</td>
                    </tr>
                    <tr>
                        <td>长沙保利瑜璟阁...</td>
                        <td><span class="roomstyle-price1">收入</span></td>
                        <td>2017/10/17</td>
                        <td>房费</td>
                        <td><span class="roomstyle-price1">895689.86</span></td>
                        <td>转账</td>
                        <td>中国银行</td>
                        <td>8985698568956256</td>
                        <td>8985698568956</td>
                        <td><span class="roomstyle-price1">已结算</span></td>
                        <td>李丽丽</td>
                        <td>2017/10/17</td>
                    </tr>
                    <tr>
                        <td>长沙保利瑜璟阁...</td>
                        <td><span class="roomstyle-price">支出</span></td>
                        <td>2017/10/17</td>
                        <td>房费</td>
                        <td><span class="roomstyle-price1">895689.86</span></td>
                        <td>转账</td>
                        <td>中国银行</td>
                        <td>8985698568956256</td>
                        <td>8985698568956</td>
                        <td><span class="roomstyle-price">未结算</span></td>
                        <td>李丽丽</td>
                        <td>2017/10/17</td>
                    </tr>
                    <tr>
                        <td>长沙保利瑜璟阁...</td>
                        <td><span class="roomstyle-price1">收入</span></td>
                        <td>2017/10/17</td>
                        <td>房费</td>
                        <td><span class="roomstyle-price1">895689.86</span></td>
                        <td>转账</td>
                        <td>中国银行</td>
                        <td>8985698568956256</td>
                        <td>8985698568956</td>
                        <td><span class="roomstyle-price1">已结算</span></td>
                        <td>李丽丽</td>
                        <td>2017/10/17</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <!--<table id="reconciliation-form"></table>-->
        <div class="reconciliation-number">
            <div class="reconciliation-gain"><span>已收款:</span><span class="roomstyle-price1">20000</span></div>
            <div class="reconciliation-paid"><span>已付款:</span><span class="roomstyle-price">20000</span></div>
        </div>
        <div class="layui-form">
            <table class="layui-table" lay-skin="line" lay-size="lg" id="tableExcel">
                <colgroup>
                    <col width="230">
                    <col width="205">
                    <col width="120">
                    <col width="160">
                    <col width="160">
                    <col width="160">
                    <col width="160">
                    <col width="160">
                    <col width="100">
                    <col width="100">
                    <col width="160">
                </colgroup>
                <thead>
                <tr>
                    <th>订单号/创建时间</th>
                    <th>酒店名称/房型</th>
                    <th>客户</th>
                    <th>销售总价</th>
                    <th>成本总价</th>
                    <th>所属业务员</th>
                    <th>收款结算状态</th>
                    <th>付款结算状态</th>
                    <th>实收</th>
                    <th>实付</th>
                    <th>账单流水</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td>
                        <div class="double-line">
                            <span class="">449117555</span>
                            <span class="">2017-12-20    12:20:26</span>
                        </div>
                    </td>
                    <td>
                        <div class="double-line">
                            <span class="">江山帝景华天商务酒店</span>
                            <span class="">豪华双人房</span>
                        </div>
                    </td>
                    <td><div class="single-line">李易峰</div></td>
                    <td><div class="single-line">20000</div></td>
                    <td><div class="single-line">20000</div></td>
                    <td><div class="single-line">李易峰</div></td>
                    <td><div class="single-line roomstyle-price">未结算</div></td>
                    <td><div class="single-line roomstyle-price">未结算</div></td>
                    <td><div class="single-line roomstyle-price1">20000</div></td>
                    <td><div class="single-line roomstyle-price1">20000</div></td>
                    <td>
                        <a class="single-line look-water-detail">
                            <button data-method="offset" data-type="auto" class="layui-btn layui-btn-normal">查看流水</button>
                        </a>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="double-line">
                            <span class="">449117555</span>
                            <span class="">2017-12-20    12:20:26</span>
                        </div>
                    </td>
                    <td>
                        <div class="double-line">
                            <span class="">江山帝景华天商务酒店</span>
                            <span class="">豪华双人房</span>
                        </div>
                    </td>
                    <td><div class="single-line">李易峰</div></td>
                    <td><div class="single-line">20000</div></td>
                    <td><div class="single-line">20000</div></td>
                    <td><div class="single-line">李易峰</div></td>
                    <td><div class="single-line roomstyle-price">未结算</div></td>
                    <td><div class="single-line roomstyle-price">未结算</div></td>
                    <td><div class="single-line roomstyle-price1">20000</div></td>
                    <td><div class="single-line roomstyle-price1">20000</div></td>
                    <td> <a class="single-line look-water-detail">
                        <button data-method="offset" data-type="auto" class="layui-btn layui-btn-normal">查看流水</button>
                    </a></td>
                </tr>
                <tr>
                    <td>
                        <div class="double-line">
                            <span class="">449117555</span>
                            <span class="">2017-12-20    12:20:26</span>
                        </div>
                    </td>
                    <td>
                        <div class="double-line">
                            <span class="">江山帝景华天商务酒店</span>
                            <span class="">豪华双人房</span>
                        </div>
                    </td>
                    <td><div class="single-line">李易峰</div></td>
                    <td><div class="single-line">20000</div></td>
                    <td><div class="single-line">20000</div></td>
                    <td><div class="single-line">李易峰</div></td>
                    <td><div class="single-line roomstyle-price">未结算</div></td>
                    <td><div class="single-line roomstyle-price">未结算</div></td>
                    <td><div class="single-line roomstyle-price1">20000</div></td>
                    <td><div class="single-line roomstyle-price1">20000</div></td>
                    <td> <a class="single-line look-water-detail">
                        <button data-method="offset" data-type="auto" class="layui-btn layui-btn-normal">查看流水</button>
                    </a></td>
                </tr>
                <tr>
                    <td>
                        <div class="double-line">
                            <span class="">449117555</span>
                            <span class="">2017-12-20    12:20:26</span>
                        </div>
                    </td>
                    <td>
                        <div class="double-line">
                            <span class="">江山帝景华天商务酒店</span>
                            <span class="">豪华双人房</span>
                        </div>
                    </td>
                    <td><div class="single-line">李易峰</div></td>
                    <td><div class="single-line">20000</div></td>
                    <td><div class="single-line">20000</div></td>
                    <td><div class="single-line">李易峰</div></td>
                    <td><div class="single-line roomstyle-price">未结算</div></td>
                    <td><div class="single-line roomstyle-price">未结算</div></td>
                    <td><div class="single-line roomstyle-price1">20000</div></td>
                    <td><div class="single-line roomstyle-price1">20000</div></td>
                    <td> <a class="single-line look-water-detail">
                        <button data-method="offset" data-type="auto" class="layui-btn layui-btn-normal">查看流水</button>
                    </a></td>
                </tr>
                <tr>
                    <td>
                        <div class="double-line">
                            <span class="">449117555</span>
                            <span class="">2017-12-20    12:20:26</span>
                        </div>
                    </td>
                    <td>
                        <div class="double-line">
                            <span class="">江山帝景华天商务酒店</span>
                            <span class="">豪华双人房</span>
                        </div>
                    </td>
                    <td><div class="single-line">李易峰</div></td>
                    <td><div class="single-line">20000</div></td>
                    <td><div class="single-line">20000</div></td>
                    <td><div class="single-line">李易峰</div></td>
                    <td><div class="single-line roomstyle-price">未结算</div></td>
                    <td><div class="single-line roomstyle-price">未结算</div></td>
                    <td><div class="single-line roomstyle-price1">20000</div></td>
                    <td><div class="single-line roomstyle-price1">20000</div></td>
                    <td> <a class="single-line look-water-detail">
                        <button data-method="offset" data-type="auto" class="layui-btn layui-btn-normal">查看流水</button>
                    </a></td>
                </tr>
                <tr>
                    <td>
                        <div class="double-line">
                            <span class="">449117555</span>
                            <span class="">2017-12-20    12:20:26</span>
                        </div>
                    </td>
                    <td>
                        <div class="double-line">
                            <span class="">江山帝景华天商务酒店</span>
                            <span class="">豪华双人房</span>
                        </div>
                    </td>
                    <td><div class="single-line">李易峰</div></td>
                    <td><div class="single-line">20000</div></td>
                    <td><div class="single-line">20000</div></td>
                    <td><div class="single-line">李易峰</div></td>
                    <td><div class="single-line roomstyle-price">未结算</div></td>
                    <td><div class="single-line roomstyle-price">未结算</div></td>
                    <td><div class="single-line roomstyle-price1">20000</div></td>
                    <td><div class="single-line roomstyle-price1">20000</div></td>
                    <td> <a class="single-line look-water-detail">
                        <button data-method="offset" data-type="auto" class="layui-btn layui-btn-normal">查看流水</button>
                    </a></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div id="reconciliation-paging"></div>
    </div>
    <div class="easytrip-footer">
        copyright by 湖南易旅科技有限公司 2017
    </div>
</div>
</div>
<script type="text/javascript" src="../lib/jquery.min.js"></script>
<script src="../lib/layui/layui.js"></script>
<script src="../js/base.js"></script>
<script src="../js/easytrip-settlement-reconciliation.js"></script>
<script language="JavaScript" type="text/javascript">
    function method2(tableid)
    {

        var curTbl = document.getElementById(tableid);
        var oXL = new ActiveXObject("Excel.Application");
        var oWB = oXL.Workbooks.Add();
        var oSheet = oWB.ActiveSheet;
        var Lenr = curTbl.rows.length;
        for (i = 0; i < Lenr; i++)
        {        var Lenc = curTbl.rows(i).cells.length;
            for (j = 0; j < Lenc; j++)
            {
                oSheet.Cells(i + 1, j + 1).value = curTbl.rows(i).cells(j).innerText;

            }

        }
        oXL.Visible = true;
    }

    //第五种方法
    var idTmr;
    function  getExplorer() {
        var explorer = window.navigator.userAgent ;
        //ie
        if (explorer.indexOf("MSIE") >= 0) {
            return 'ie';
        }
        //firefox
        else if (explorer.indexOf("Firefox") >= 0) {
            return 'Firefox';
        }
        //Chrome
        else if(explorer.indexOf("Chrome") >= 0){
            return 'Chrome';
        }
        //Opera
        else if(explorer.indexOf("Opera") >= 0){
            return 'Opera';
        }
        //Safari
        else if(explorer.indexOf("Safari") >= 0){
            return 'Safari';
        }
    }
    function method5(tableid) {
        if(getExplorer()=='ie')
        {
            var curTbl = document.getElementById(tableid);
            var oXL = new ActiveXObject("Excel.Application");
            var oWB = oXL.Workbooks.Add();
            var xlsheet = oWB.Worksheets(1);
            var sel = document.body.createTextRange();
            sel.moveToElementText(curTbl);
            sel.select();
            sel.execCommand("Copy");
            xlsheet.Paste();
            oXL.Visible = true;

            try {
                var fname = oXL.Application.GetSaveAsFilename("Excel.xls", "Excel Spreadsheets (*.xls), *.xls");
            } catch (e) {
                print("Nested catch caught " + e);
            } finally {
                oWB.SaveAs(fname);
                oWB.Close(savechanges = false);
                oXL.Quit();
                oXL = null;
                idTmr = window.setInterval("Cleanup();", 1);
            }

        }
        else
        {
            tableToExcel(tableid)
        }
    }
    function Cleanup() {
        window.clearInterval(idTmr);
        CollectGarbage();
    }
    var tableToExcel = (function() {
        var uri = 'data:application/vnd.ms-excel;base64,',
            template = '<html><head><meta charset="UTF-8"></head><body><table>{table}</table></body></html>',
            base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) },
            format = function(s, c) {
                return s.replace(/{(\w+)}/g,
                    function(m, p) { return c[p]; }) }
        return function(table, name) {
            if (!table.nodeType) table = document.getElementById(table)
            var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}
            window.location.href = uri + base64(format(template, ctx))
        }
    })()
</script>
</body>
</html>